package hjd.game.common;

public enum PlayerColorEnum {
    PLAYER_COLOR_RED(1,"red"),
    PLAYER_COLOR_BLUE(2,"blue");
    private Integer code;
    private String value;

    PlayerColorEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValueByCode(Integer code){
        for (PlayerColorEnum target : PlayerColorEnum.values()) {
            if(target.code.equals(code)){
                return target.value;
            }
        }
        return null;
    }
}
